home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1936 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  48 lines

  1. Path: noc.tor.hookup.net!the-fix.sos.on.ca
  2. From: <verneb@the-fix.sos.on.ca>
  3. Date: Wed,17 Jan 96 17:34:44 -0500
  4. Newsgroups: comp.lang.c
  5. Subject: What should be returned?
  6. Message-ID: <tcpnntpd.16.1.17.17.34.44.2781597121.346998@the-fix.sos.on.ca>
  7. References: <4dj8pv$cjd@eng_ser1.erg.cuhk.hk>
  8. Organization: the FIX - Kitchener, Ontario CANADA
  9. NNTP-Posting-Host: the-fix.sos.on.ca
  10. X-MajorTCP-Version: MajorTCP/IP [1.80-0]
  11.  
  12. To: INT:phsung@cs.cuhk.hk
  13.  
  14. Int:phsung@cs.cuhk.hk,
  15.  
  16. I >Hi, all,
  17. I >
  18. I >    It's said that the function main must return an integer value
  19. I >but I just don't know what value should be returned.  Also, if I quit
  20. I >main by exit(), what's the use of the return value?
  21. I >
  22. I >    Any help?
  23. I >
  24. I >--
  25. I >Regards,
  26. I >Sung, the CAReLess boy  º║─_▒d (Ñd║╕)
  27. I >CUHK UC CSC Yr2     ¡╗┤öñññÖñj╛Ä ┴pªX«Ñ░| ¡p║î╛≈¼∞╛ÄÑD¡╫
  28. I >
  29. I >
  30.  
  31.     simply use return 0; and that will satisfy your compiler e.g.
  32.     
  33.     #include <stdio.h>
  34.     int main(void)
  35.     {
  36.         printf("This should work I think, I hope, I know it will!\n");
  37.     return 0;
  38.     }
  39.     
  40.     Main is asking for nothing so you return the same by 'return 0;'.
  41.     
  42. Verne H. Bohlender
  43. Box 416, Chesley, Ontario.Ca. N0G 1L0
  44. verneb@The-Fix.sos.on.ca
  45. ___
  46. * UniQWK #2158*
  47.  
  48.